import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import ZhJson from './zh.json'
import EnJson from './en.json'
const resources = {
  en: {
    translation: {
        EnJson
    }
  },
  zh: {
    translation: {
        ZhJson
    }
  }
};

i18n
  .use(initReactI18next) // passes i18n down to react-i18next
  .init({
    resources,
    lng: localStorage.getItem('i18n')||'zh', 
    interpolation: {
      escapeValue: false // react already safes from xss
    }
  });

  export default i18n;